package de.szut.traineeslife.fragments;

import android.content.ContentResolver;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;

import com.actionbarsherlock.app.SherlockFragment;

import de.szut.traineeslife.R;
import de.szut.traineeslife.data.Report;
import de.szut.traineeslife.db.ReportContract;
import de.szut.traineeslife.utils.ReportsHelper;
import de.szut.traineeslife.utils.ReportsListener;

public class ReportFragment extends SherlockFragment{
    
    private EditText editReport;
    private EditText editHours;
    private ReportsListener mReportsListener;
    private ReportsHelper mReportsHelper;
    
    public ReportFragment(){
        
    }
    public ReportFragment(ReportsListener reportsListener,ReportsHelper reportsHelper){
    	mReportsListener = reportsListener;
    	mReportsHelper = reportsHelper;
    }

    @Override
    public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState ) {
       View rootView = inflater.inflate(R.layout.fragment_report_weekly,container,false );
       editReport = (EditText) rootView.findViewById( R.id.reports_text );
       editHours = (EditText) rootView.findViewById(R.id.reports_hours);
//       saveBtn = (Button) rootView.findViewById(R.id.save_btn);
//       saveBtn.setOnClickListener(new OnClickListener() {
//		
//		@Override
//		public void onClick(View v) {
//			if(editReport.getText() != null && editHours.getText() != null){
//				mReportsListener.getReportsData(editReport.getText().toString(), editHours.getText().toString());
//				Report report = new Report(mReportsHelper.getReportTitel(), "", "", mReportsHelper.getReportsText(), "", mReportsHelper.getReportsHours(), "");
////				if (report != null) {
////					final ContentResolver cr = getActivity().getContentResolver();
////					cr.insert(ReportContract.Report.CONTENT_URI, report.toContentValues());
////				}
//			}
//			
//		}
//	});
        return rootView;
    }
}
